/*******************************************************************************
 * This file is part of blueprint4j www.blueprint4j.org.
 * 
 *     blueprint4j is free software: you can redistribute it and/or modify
 *     it under the terms of the GNU Lesser General Public License as published by
 *     the Free Software Foundation, either version 3 of the License, or
 *     (at your option) any later version.
 * 
 *     blueprint4j is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU Lesser General Public License for more details.
 * 
 *     You should have received a copy of the GNU Lesser General Public License
 *     along with blueprint4j. If not, see <http://www.gnu.org/licenses/>.
 ******************************************************************************/
package blueprint4j.db;

import blueprint4j.utils.BindException;
import blueprint4j.utils.BindLongInterface;
import blueprint4j.utils.Bindable;
import blueprint4j.utils.Log;
import blueprint4j.utils.VectorBindFieldRequire;

public class FieldGroupChild extends FieldGroup implements BindLongInterface {
	private static final long serialVersionUID = 1L;
	private EntityChild childEntity;

	public FieldGroupChild(String name,EntityChild childEntity,Entity entity) {
		super(name,entity);
		this.childEntity=childEntity;
	}

	@Override
	public Long get() {
		try {
			return getEntity().id.getAsLong();
		} catch (DataException e) {
			Log.critical.out(e.getMessage(),e);
		}
		return 0l;
	}

	@Override
	public void set(Long value) {
		// Won't allow setting here
	}

	@Override
	public Bindable getBindable() {
		return getEntity();
	}

	@Override
	public String getDescription() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public VectorBindFieldRequire getFieldRequirement() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Object getObject() throws BindException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getSerializable() throws BindException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getValueAsString() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean getVisibleByDefault() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean isChanged() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void setBindable(Bindable bindable) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void setChanged(boolean changed) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void setName(String name) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void setObject(Object value) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void setSerializable(String value) throws BindException {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void setVisibleByDefault(boolean visible) {
		// TODO Auto-generated method stub
		
	}

}

